package com.xmhmyh.generalframework.framework.config;

import cn.hutool.core.date.DateUtil;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * @Author: 于丁
 * @DateTime: 2019/12/24 2:38 下午
 */
@Component
@ConfigurationProperties(prefix = "alioss")
@Data
public class AliOssConfig {
    private String accessId;
    private String accessKey;
    private String endpoint;
    private String bucket;
    private String dir;
    private String printDir;
    private String host;


    public String getDir() {
        return dir + "/" + DateUtil.format(LocalDateTime.now(), "yyyyMMdd") + "/";
    }
    public String getVideoDir() {
        return printDir + "/" + DateUtil.format(LocalDateTime.now(), "yyyyMMdd") + "/";
    }

}
